#ifndef BROWSERWIDGET_H
#define BROWSERWIDGET_H

#include <QWidget>
#include <QUrl>

namespace Ui {
	class BrowserWidget;
}

class QMenu;
class QCompleter;

class DownloadsManager;
class HistoryManager;

namespace Legenday{

class ConfigurationManager;

class BrowserWidget : public QWidget
{
	Q_OBJECT

public:
	explicit BrowserWidget(QWidget *parent=NULL, ConfigurationManager *config=NULL);
	~BrowserWidget();
	void setConfigurationManager(ConfigurationManager *);
	ConfigurationManager* getConfigurationManager();

public slots:
	void on_lineAddress_returnPressed();
	void on_webView_loadStarted();
	void on_webView_loadFinished(bool);
	void on_newCommand_triggered();

	void copy();
	void cut();
	void paste();
	void setUrl(QUrl);

	void saveWebPage();
	void find();
	void printWebPage();
	void showBookmarks();
	// void showTools();
	void showHistory();
	void showDownloads();
	void showOptions();

	void selectUrlBar();

private slots:
	void editActionsClicked(QString);
	void on_titleChanged(QString);

signals:
	void titleChanged(QString);

private:
	void setupToolbarMenu();
	void setupMainToolbar();

	QCompleter           *m_completer;
	QMenu                *m_configurationMenu;
	ConfigurationManager *m_configurationManager;
	Ui::BrowserWidget    *ui;
};

}

#endif // BROWSERWIDGET_H
